try_call
Calls a function that doesn't return a value and handles exceptions gracefully.
Return
true
if call succeeds, false
otherwise.
Since
0.13.0
Parameters
fn
The function to be called.
Calls a function and handles exceptions gracefully, returning null if an exception occurs.
Return
T
if call succeeds, null
otherwise.
Since
0.13.0
Parameters
fn
The function to be called.
Calls a function and handles exceptions gracefully, providing a fallback value if an exception occurs.
Return
T
if call succeeds and the supplied default value otherwise.
Since
0.13.0
Parameters
fn
The function to be called.
default
The fallback value to be returned if an exception occurs.